begintalkscript;
variables;

begintalknode 1;
state = -1;
personality = 50;
nextstate = 1;
question = "Frank";
text1 = "However bizarre it may seem, this ghoul is currently playing chess with his undead pal.  _Hey,_ he says as you approach.  _Been a while since people who aren't dead came down here.  Hey, when was the last time we saw one, Bert?_";
text2 = "His friend says shortly, and somewhat impatiently, _Never, Frank._  'Frank' turns back to you and says, _Well, my memory's been going of late.  Probably 'cause of my brain decaying and all that, but hey, what's a ghoul gonna do about it?_";
text3 = "_But anyway, I'm Frank and this is Bert._  His companion nods to you.  _We've been in this pit awhile, but we're still sane unlike the other ones.  But enough about us.  How's the world of the living been for ya?_";
text4 = "He pushes a pawn forward.  _And while we're talkin' about you, just what're you doing down here in a deathpit like this?  It's not fit for living things, doncha know._";
text5 = "Frank is still playing chess happily with his buddy.  _Hey, it's the living again!  How ya been?  Need something?_";
action = INTRO;

begintalknode 2;
state = 1;
personality = 50;
nextstate = -1;
condition = get_flag(3,2) == 0;
question = "I'm seeking the treasures deeper in this cave.";
text1 = "He nods knowingly.  _Yeah, that's what we all came for too.  I haven't gone deeper in because I'd rather just sit here, safe and sound. One death is enough for me._";
text2 = "_But good luck with your treasure hunting.  I'm sure you'll need it._";
code = 
	set_flag(3,2,1);
break;

begintalknode 3;
state = 1;
nextstate = 2;
condition = get_flag(3,2) == 1;
question = "How did you get down here?";
text1 = "_Same as the rest.  Wanted treasure, fought golems, lost, golems threw our corpses inside, and the lucky ones landed past the entrance trap._";

begintalknode 4;
state = 2;
nextstate = -1;
question = "Why don't you try to leave?  I deactivated the trap.";
text1 = "He laughs.  _Leave?  And then what?  I'm dead.  I step outside and instantly I'd be pierced by some overzealous adventurer's spear.  I've thought about trying to escape, trust me.  It's not an option._";

begintalknode 5;
state = 2;
nextstate = -1;
question = "How long have you been in this pit?";
text1 = "He shrugs.  _I can't tell the time down here.  It's been awhile.  Being undead, I don't need to sleep, so I really don't have any idea._";

begintalknode 6;
state = 2;
nextstate = -1;
question = "Do you have any idea why you became undead when you were killed?";
text1 = "He shakes his head, accidentally knocking an eyeball loose from its socket.  _Nope!_ he says, as he tries to place it back where it belongs.";
code = 
	set_flag(3,4,1);
break;

begintalknode 7;
state = 1;
nextstate = -1;
condition = get_flag(3,2) == 1;
question = "Why're you playing chess?";
text1 = "_'Cause it's fun!  'Sides, we got nothing else to do._  He leans toward you confidentially and lowers his voice.  _Bert doesn't like to admit it, but he usually loses.  I'm a much better chess player._";
code = 
	set_flag(3,3,1);
break;

begintalknode 8;
state = 1;
nextstate = -1;
condition = get_flag(3,2) == 1;
question = "Hey, do you want to go seek the treasure with me?";
text1 = "He thinks for a moment, then says, _'Fraid not.  I don't have any use for gold or anything, and I don't feel like risking my neck.  Again._";

begintalknode 10;
state = -1;
personality = 50;
nextstate = 3;
question = "Bert";
text1 = "This ghast nods to you in greeting.  _So the living finally made their way down here, eh?  How'd you get in and why?_";
text2 = "_Hey, Bert, can't you be more polite?_ the other says to the ghast.  _Fine,_ he sighs, and 'Bert' moves his bishop a couple of spaces.  _I'm Bert and this is my friend Frank._  _Hi!_ his friend chimes in.  _Anyway,_ says Bert, _what are you doing here?_";
text5 = "Bert nods to you and then continues playing chess.  _Something you want?_ he says over his shoulder.";
action = INTRO;

begintalknode 11;
state = 3;
nextstate = -1;
condition = get_flag(3,2) == 0;
question = "I'm seeking the treasures deeper in this cave.";
text1 = "He nods.  _I see.  We came here for the same reason.  But we gave up after being killed by the golems, so we stayed put.  I don't feel like dying again.  It's not a pleasant experience._";
text2 = "_Good luck to you, then, if you intend to go further.  You'll definitely need it._";
code = 
	set_flag(3,2,1);
break;

begintalknode 12;
state = 3;
nextstate = -1;
condition = get_flag(3,2) == 1;
question = "How did you come to be down here?";
text1 = "He falls silent.  _Why don't you ask Frank about it,_ he says after a pause.";

begintalknode 13;
state = 3;
nextstate = -1;
condition = (get_flag(3,4) && get_flag(3,2)) == 1;
question = "Why do you think you became undead?";
text1 = "_I don't rightly know.  I think this place has a curse of some sort, but other than that theory I haven't the slightest._";

begintalknode 14;
state = 3;
nextstate = -1;
condition = (get_flag(3,3) == 1);
question = "Frank says he's better than you at chess.";
text1 = "Bert chuckles wryly.  _He always says that.  Even though I always win, he's got it into his head that I keep winning by flukes.  I don't bother to correct him anymore._";
code = 
	set_flag(3,3,2);
break;